from kafka import KafkaProducer

kafkaClient=KafkaProducer(bootstrap_servers='xx.xx.xx.203:9092')

def start_producer(msg):

    kafkaClient.send('t_jg_lt_producer',msg.encode())
    kafkaClient.flush()
    print("客户端发送完成：%s"%msg)


if __name__=='__main__':
    msg="你好吗，我的小伙伴，miomiao"
    start_producer(msg)